<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

class RequestController extends Controller
{


   
	public function getInfo(Request $request){
		// echo $request->method();
		// var_dump($request->isMethod('post'));
		// dd($request->ip());
		dd($request->getPort());
		dd($request->url());
	}

	public function postParam(Request $request){
		// dd($request->all());
		// dd($request->input('age'));//获取Name名的值

		// $name=$request->all('time',time());
		// $name['xxxx']='0000';
		// dd($name);
		// if($request->has('age')){
		// 	echo '存在';
		// }else{
		// 	echo '不存在';
		// }

		// dd($request->only(['uname','age']));
		// dd($request->all());
		// dd($request->except(['_token']));

		dd($request->header('Cookie'));

	}

	public function upload(){
		return view('request.form1');
	}

	public function postDoupload(Request $request){
		// var_dump($request->file('file'));
		// dd($request->file('file'));
		if($request->hasFile('file')){
			// $request->file('file')->move('./uploads','xxxxx.jpg');
			$picname=md5(time()+rand(0,99));
			$path=\Config::get('app.upload_dir');
			// echo $path;
			$extension=$request->file('file')->getClientOriginalExtension();
			$request->file('file')->move($path,$picname.'.'.$extension);


		}else{
			echo '没有这个上传';
		}
	}

}
